//
// Copyright (C) 2011 - 2013  Steve Channell steve.channell@cepheis.com
//
// This file is part of Cephei.QL, an open-source library wrapper 
// arround QuantLib http://quantlib.org/
//
// Cephei.QL is open source software: you can redistribute it and/or modify it
// under the terms of the license.  You should have received a
// copy of the license along with this program; if not, please email
// <support@cepheis.com>. The license is also available online at
// <http://cepheis.com/license.htm>.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE.  See the license for more details.
//
// Version 2.2 with QuantLib 1.2.1
//#include "stdafx.h"
#include "MixedLinearParabolic.h"
using namespace Cephei::QL::Math::Interpolations;
#include <gen/QL/Math/Interpolations/MixedLinearCubicInterpolation.h>
#undef HANDLE
#undef ABSTRACT
#undef STRUCT
Cephei::QL::Math::Interpolations::CMixedLinearParabolic::CMixedLinearParabolic (boost::shared_ptr<QuantLib::MixedLinearParabolic>& childNative, Object^ owner) : CMixedLinearCubicInterpolation(CMixedLinearParabolic::typeid)
{
#ifdef HANDLE
	_phMixedLinearParabolic = NULL;
#endif
	_ppMixedLinearParabolic = &childNative;
    _ppMixedLinearCubicInterpolation = new boost::shared_ptr<QuantLib::MixedLinearCubicInterpolation> (boost::dynamic_pointer_cast<QuantLib::MixedLinearCubicInterpolation> (*_ppMixedLinearParabolic));
}
Cephei::QL::Math::Interpolations::CMixedLinearParabolic::CMixedLinearParabolic (QuantLib::MixedLinearParabolic& childNative, Object^ owner) : CMixedLinearCubicInterpolation(CMixedLinearParabolic::typeid)
{
#ifdef HANDLE
	_phMixedLinearParabolic = NULL;
#endif
	_ppMixedLinearParabolic = new boost::shared_ptr<QuantLib::MixedLinearParabolic> (&childNative);
    _ppMixedLinearCubicInterpolation = new boost::shared_ptr<QuantLib::MixedLinearCubicInterpolation> (boost::dynamic_pointer_cast<QuantLib::MixedLinearCubicInterpolation> (*_ppMixedLinearParabolic));
    _MixedLinearParabolicOwner = owner;
    _MixedLinearCubicInterpolationOwner = owner;
}

Cephei::QL::Math::Interpolations::CMixedLinearParabolic::CMixedLinearParabolic (CMixedLinearParabolic^ copy) : CMixedLinearCubicInterpolation(CMixedLinearParabolic::typeid)
{
#ifdef HANDLE
	_phMixedLinearParabolic = NULL;
#endif
	if (copy->HasNative() != NULL)
    {
		_ppMixedLinearParabolic = new boost::shared_ptr<QuantLib::MixedLinearParabolic> (copy->GetShared());
        _ppMixedLinearCubicInterpolation = new boost::shared_ptr<QuantLib::MixedLinearCubicInterpolation> (boost::dynamic_pointer_cast<QuantLib::MixedLinearCubicInterpolation> (*_ppMixedLinearParabolic));
    }
}
Cephei::QL::Math::Interpolations::CMixedLinearParabolic::CMixedLinearParabolic (PLATFORM::Type^ t) : CMixedLinearCubicInterpolation(CMixedLinearParabolic::typeid)
{
#ifdef HANDLE
	_phMixedLinearParabolic = NULL;
#endif
	if (!t->IsSubclassOf(CMixedLinearParabolic::typeid))
		throw REFNEW Exception ("Invalid base-case init");
}
#ifdef HANDLE
Cephei::QL::Math::Interpolations::CMixedLinearParabolic::CMixedLinearParabolic (QuantLib::Handle<QuantLib::MixedLinearParabolic>& childNative, Object^ owner)  : CMixedLinearCubicInterpolation(CMixedLinearParabolic::typeid)
{
	_phMixedLinearParabolic = &childNative;
	_ppMixedLinearParabolic = &static_cast<boost::shared_ptr<QuantLib::MixedLinearParabolic>>(childNative.currentLink());
    _ppMixedLinearCubicInterpolation = new boost::shared_ptr<QuantLib::MixedLinearCubicInterpolation> (boost::dynamic_pointer_cast<QuantLib::MixedLinearCubicInterpolation> (*_ppMixedLinearParabolic));
    _MixedLinearParabolicOwner = owner;
}
Cephei::QL::Math::Interpolations::CMixedLinearParabolic::CMixedLinearParabolic (QuantLib::Handle<QuantLib::MixedLinearParabolic> childNative)  : CMixedLinearCubicInterpolation(CMixedLinearParabolic::typeid)
{
	_phMixedLinearParabolic = &childNative;
	_ppMixedLinearParabolic = &static_cast<boost::shared_ptr<QuantLib::MixedLinearParabolic>>(childNative.currentLink());
    _ppMixedLinearCubicInterpolation = new boost::shared_ptr<QuantLib::MixedLinearCubicInterpolation> (boost::dynamic_pointer_cast<QuantLib::MixedLinearCubicInterpolation> (*_ppMixedLinearParabolic));
}
#endif
#ifdef STRUCT
Cephei::QL::Math::Interpolations::CMixedLinearParabolic::CMixedLinearParabolic (QuantLib::MixedLinearParabolic childNative)  : CMixedLinearCubicInterpolation(CMixedLinearParabolic::typeid)
{
#ifdef HANDLE
	_phMixedLinearParabolic = NULL;
#endif
	_ppMixedLinearParabolic = new boost::shared_ptr<QuantLib::MixedLinearParabolic> (new QuantLib::MixedLinearParabolic (childNative));
    _ppMixedLinearCubicInterpolation = new boost::shared_ptr<QuantLib::MixedLinearCubicInterpolation> (boost::dynamic_pointer_cast<QuantLib::MixedLinearCubicInterpolation> (*_ppMixedLinearParabolic));
}
#endif

Cephei::QL::Math::Interpolations::CMixedLinearParabolic::~CMixedLinearParabolic ()
{
    if (_ppMixedLinearParabolic != NULL)
    {
	    delete _ppMixedLinearParabolic;
        _ppMixedLinearParabolic = NULL;
    }
}
Cephei::QL::Math::Interpolations::CMixedLinearParabolic::!CMixedLinearParabolic ()
{
    if (_ppMixedLinearParabolic != NULL)
    {
	    delete _ppMixedLinearParabolic;
    }
}
QuantLib::MixedLinearParabolic& Cephei::QL::Math::Interpolations::CMixedLinearParabolic::GetReference ()
{
    if (_ppMixedLinearParabolic == NULL) throw REFNEW NativeNullException ();
	return **_ppMixedLinearParabolic;
}
boost::shared_ptr<QuantLib::MixedLinearParabolic>& Cephei::QL::Math::Interpolations::CMixedLinearParabolic::GetShared ()
{
    if (_ppMixedLinearParabolic == NULL) throw REFNEW NativeNullException ();
	return *_ppMixedLinearParabolic;
}
QuantLib::MixedLinearParabolic* Cephei::QL::Math::Interpolations::CMixedLinearParabolic::GetPointer ()
{
    if (_ppMixedLinearParabolic == NULL) throw REFNEW NativeNullException ();
	return &**_ppMixedLinearParabolic;
}
#ifdef HANDLE
QuantLib::Handle<QuantLib::MixedLinearParabolic>& Cephei::QL::Math::Interpolations::CMixedLinearParabolic::GetHandle ()
{
	if (_phMixedLinearParabolic == NULL)
	{
		_phMixedLinearParabolic = new Handle<QuantLib::MixedLinearParabolic> (*_ppMixedLinearParabolic);
	}
	return *_phMixedLinearParabolic;
}
#endif
bool Cephei::QL::Math::Interpolations::CMixedLinearParabolic::HasNative () 
{
	return (_ppMixedLinearParabolic != NULL);
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Factory class

